package com.wuercloud.http.transmit;

import com.wuercloud.http.json.pojo.DoorInfo;
import com.wuercloud.http.json.pojo.InfoObject;
import com.wuercloud.utils.FastJsonUtils;

import java.util.concurrent.Callable;

/**
 * Created by JiangWL on 2017/3/1.
 */
public class InfoAnalyzer implements Callable<String> {
    private InfoObject info ;

    public InfoAnalyzer(final InfoObject infoObject) {
        this.info = infoObject;
    }

    @Override
    public String call() throws Exception {
        System.out.println("根据业务类型处理业务，业务标识为： "+this.info.getBizType());
        //if (this.info.getBizType().contains("1")){
        DoorInfo doorInfo = FastJsonUtils.jsonToPojo(this.info.getInfos().stream().findFirst().get().toString(),DoorInfo.class);
            //DoorInfo doorInfo = (DoorInfo) this.info.getInfos().stream().findFirst().get();

            System.out.println("doorInfo内容："+doorInfo.toString());
        //}
        return "200";
    }
}
